		// change condition view
//		var td_rule_cond_tab = tr_tab.children(".rule_cond");
//		var div_cond_json_tab = td_rule_cond_tab.children(".rule_cond_json");
//		var div_cond_parsed_tab = td_rule_cond_tab.children(".rule_cond_parsed");
//		div_cond_json_tab.show();
//		div_cond_parsed_tab.hide();
		
		// change action view
//		var td_rule_action_tab = tr_tab.children(".rule_action");
//		var div_action_json_tab = td_rule_action_tab.children(".rule_action_json");
//		var div_action_parsed_tab = td_rule_action_tab.children(".rule_action_parsed");
//		div_action_json_tab.show();
//		div_action_parsed_tab.hide();
		
		// enable check box
//		var td_rule_enabled_tab = tr_tab.children(".rule_enabled");
//		var rule_enabled_checkbox = td_rule_enabled_tab.children(".rule_enabled_checkbox");
//		rule_enabled_checkbox.removeAttr("disabled");
		
		// enable cancel button
//		var td_action_tab = tr_tab.children(".action");
//		var btn_cancel = td_action_tab.children("a.btn.cancel");
//		btn_cancel.show();


// change condition view
//		var td_rule_cond_tab = tr_tab.children(".rule_cond");
//		var div_cond_json_tab = td_rule_cond_tab.children(".rule_cond_json");
//		var div_cond_parsed_tab = td_rule_cond_tab.children(".rule_cond_parsed");
//		div_cond_json_tab.hide();
//		div_cond_parsed_tab.show();
		
		// change action view
//		var td_rule_action_tab = tr_tab.children(".rule_action");
//		var div_action_json_tab = td_rule_action_tab.children(".rule_action_json");
//		var div_action_parsed_tab = td_rule_action_tab.children(".rule_action_parsed");
//		div_action_json_tab.hide();
//		div_action_parsed_tab.show();
		
		// disable check box
//		var td_rule_enabled_tab = tr_tab.children(".rule_enabled");
//		var rule_enabled_checkbox = td_rule_enabled_tab.children(".rule_enabled_checkbox");
//		rule_enabled_checkbox.attr('disabled', 'disabled');
		
		// enable edit button
//		var td_action_tab = tr_tab.children(".action");
//		var btn_edit = td_action_tab.children("a.btn.edit");
//		btn_edit.show();


// change condition view
//		var td_rule_cond_tab = tr_tab.children(".rule_cond");
//		var div_cond_json_tab = td_rule_cond_tab.children(".rule_cond_json");
//		var div_cond_parsed_tab = td_rule_cond_tab.children(".rule_cond_parsed");
//		div_cond_json_tab.show();
//		div_cond_parsed_tab.hide();
		
		// change action view
//		var td_rule_action_tab = tr_tab.children(".rule_action");
//		var div_action_json_tab = td_rule_action_tab.children(".rule_action_json");
//		var div_action_parsed_tab = td_rule_action_tab.children(".rule_action_parsed");
//		div_action_json_tab.show();
//		div_action_parsed_tab.hide();
		
		// enable check box
//		var td_rule_enabled_tab = tr_tab.children(".rule_enabled");
//		var rule_enabled_checkbox = td_rule_enabled_tab.children(".rule_enabled_checkbox");
//		rule_enabled_checkbox.removeAttr("disabled");
		
		// enable cancel button
//		var td_action_tab = tr_tab.children(".action");
//		var btn_cancel = td_action_tab.children("a.btn.cancel");
//		btn_cancel.show();



//$(".rule_action_json").hide();
		//$("a.btn.cancel").hide();
		/*
		$("#frmRules").delegate("a.btn.edit","click",function(){
			// enable editable GUI
            var tr_tab = $(this).parent().parent();
			enableRuleEdit(tr_tab);
			
			// change button
			$(this).removeClass(".edit").addClass("cancel").text("Cancel");
            return false;
		});		
        
		$("#frmRules").delegate("a.btn.cancel","click",function(){
			// enable editable GUI
            var tr_tab = $(this).parent().parent();
			disableRuleEdit(tr_tab);
			
			// change button
			$(this).removeClass(".cancel").addClass("cancel").text("Cancel");
            return false;
		});
		*/
		
		
		
		
		<div class="div_condition" style="margin-top:3px">
			<select name="condition_tyles[]">
				<option value="RULE_CONDITION_LOCATION">location</option>
				<option value="RULE_CONDITION_STOCK">stock</option>
				<option value="RULE_CONDITION_SKU">sku </option>
				<option value="RULE_CONDITION_DATE">date </option>
			</select> 
			<select name="condition_operators[]">
				<option value="equal">equal to</option>
				<option value="not_equal">not equal to</option>
				<option value="less_than">less than</option>
				<option value="less_than_equal">less than equal to </option>
				<option value="greater_than">greater than</option>
				<option value="greater_than_equal">greater than equal to </option>
				<option value="between">between </option>
				<option value="in">in</option>
				<option value="not_in">not in</option>
			</select>		
			<input name="condition_params[]" value=""></input> <span class="example"></span>
			<!--<button class="btn add"><span class=""></span></button>-->
			<button class="btn delete"><span class=""></span></button>
	</div>
	
	
	.ico-24{
	padding: 5px 17px 5px 11px !important;
	cursor: pointer !important;
}

		.btn.add span{ background-position: 0 0; width: 24px; height: 24px; } 
		.btn.delete span{ background-position: -25px 0; width: 24px; height: 24px; } 
		.btn.down span{ background-position: -50px 0; width: 24px; height: 24px; } 
		.btn.edit span{ background-position: -75px 0; width: 24px; height: 24px; } 
		.btn.reset span{ background-position: -100px 0; width: 24px; height: 24px; } 
		.btn.save span{ background-position: -125px 0; width: 24px; height: 24px; } 
		.btn.up span{ background-position: -150px 0; width: 24px; height: 24px; } 


		button.btn16{			
			padding: 0px;
			position: relative;
			width: 16px; 
			height: 16px;
			background-color:transparent;
			border:none;
			cursor:pointer;
		}
		
		.btn16 span{
			background-image: url("../static/admin/images/icon_sprite_24.png");
			background-repeat: no-repeat;					
			display:block;
			position: absolute;
			top: 0;
			left: 0;
			width: 16px; 
			height: 16px;			
		}
		
		.btn16.down span{ background-position: -50px 0; width: 24px; height: 24px; } 
		.btn16.up span{ background-position: -150px 0; width: 24px; height: 24px; } 
		
		a.btn{
			border: 1px solid black;
			color: #1575BF;
			font-size: 14pt;
			padding: 6px;
			text-decoration: none;
			
		}
		a.btn:hover
		{
			text-decoration: none;
		}
		
		
		/*****css for all****/
		input[readonly="true"]
		{
			background-color:#EEEEEE;
		}
        .for_editing textarea,
		.for_editing [type="text"] ,
		.for_editing{
			width:100%;
            font-size:10pt;
        }
		
		.warning{
			color: red;
		}
		
		.btn span{
			background-image: url("../../../static/admin/images/icon_sprite_24.png");
			background-repeat: no-repeat;					
			display:block;
			position: absolute;
			top: 0;
			left: 0;
			width: 24px; 
			height: 24px;
		}
		button.btn{			
			padding: 0px;
			position: relative;
			width: 24px; 
			height: 24px;
			background-color:transparent;
			border:none;
			cursor:pointer;
		}
		
		button.btn:hover{
			border:1px solid blue;
		}
		
		button.disabled{
			opacity:0.1;
		}
		button.btn_box:hover{
			border:1px solid blue;
		}
			
		.btn.add span{ background-position: 0 0; width: 24px; height: 24px; } 
		.btn.delete span{ background-position: -25px 0; width: 24px; height: 24px; } 
		.btn.down span{ background-position: -50px 0; width: 24px; height: 24px; } 
		.btn.edit span{ background-position: -75px 0; width: 24px; height: 24px; } 
		.btn.reset span{ background-position: -100px 0; width: 24px; height: 24px; } 
		.btn.save span{ background-position: -125px 0; width: 24px; height: 24px; } 
		.btn.up span{ background-position: -150px 0; width: 24px; height: 24px; } 


		button.btn16{			
			padding: 0px;
			position: relative;
			width: 16px; 
			height: 16px;
			background-color:transparent;
			border:none;
			cursor:pointer;
		}
		
		.btn16 span{
			background-image: url("../../../static/admin/images/icon_sprite_24.png");
			background-repeat: no-repeat;					
			display:block;
			position: absolute;
			top: 0;
			left: 0;
			width: 16px; 
			height: 16px;			
		}
		
		.btn16.down span{ background-position: -50px 0; width: 24px; height: 24px; } 
		.btn16.up span{ background-position: -150px 0; width: 24px; height: 24px; } 
		
		
		button{
			font-size: 14pt;
			border: 1px solid black;
			padding: 3px 10px 5px 10px;
			cursor: pointer;
			color: #1575BF;
			background: none;
		}
		
		button:hover{
			color: #F3892D;
		}
		
		a.btn{
			border: 1px solid black;
			color: #1575BF;
			font-size: 14pt;
			padding: 6px;
			text-decoration: none;
		}
		
		a.btn:hover
		{
			text-decoration: none;
		}
		
		input[name='comment']
		{
			width: 350px;
		}
		
		
		#frmRule label{
			margin-left:10px;
		}	
		
		#frmRule label{
			margin-left:10px;
			display: block;
			float:left;
			width: 200px;
		}	
		
		#frmRule div{
			margin-left: 50px;
		}
		
		#frmRule div.condition_info{
			margin-left: 0px;
		}
		
		select.condition_tyles
		{
			width: 100px;
		}
		select.condition_operators
		{
			width: 200px;
		}
		???????????????????????????????????????????????
		 /**
     *
     *
     */
    public function updateruleAction()
    {
        // response json
        $this->_helper->viewRenderer->setNorender();

        // parse data
        $rule_data = array();
        $rule_id = $_GET['rule_id'];
        $rule_data['order'] = $_GET['rule_order'];
        $rule_data['comment'] = $_GET['rule_comment'];
        $rule_data['conditions'] = $_GET['rule_conditions'];
        $rule_data['action'] = $_GET['rule_action'];
        $rule_data['enabled'] = isset($_GET['rule_enabled'])? 1 : 0;
        
        //print_r($rule_data);
        $shippingTimeModel = new QShippingtime();        
        $result = $shippingTimeModel->updateRule($rule_data, $rule_id);
        
        // response
        $response = array('error' => 0, 'data' => null, 'msg');
        if($result == 0)
        {
	        $response['error'] = -1;
	        $response['msg'] = 'update rule failded';
        }
        else
        {
        	$rule = $shippingTimeModel->getRules(array('id' => $rule_id));
        	$rule = $rule[0];
        	
        	// conditions
        	$rule['conditions_parsed'] = $this->parseCondition($rule['conditions']);
        	
        	// ation
        	$rule['action_parsed'] = $this->parseAction($rule['action']);
        	
        	// respone
        	$response['data'] = $rule;
        }
        
        echo json_encode($response);
    }?????????????????????????????????????????????????????????
	
	$("#content").delegate(".btn.edit", "click", function(){
			var tr_tag = $(this).parent().parent();
			var rule_id = tr_tag.find("input.rule_id").val();
			window.location.href = base_url+'/shippingtime/editrule/rule_id/'+rule_id;
			//$(this).hide();			
			return false;
		});
		
		$("#content").delegate(".btn.add", "click", function(){
			var tr_tag = $(this).parent().parent();
			var rule_order = tr_tag.find("input[name='rule_order']").val();
			window.location.href = base_url+'/shippingtime/newrule?order='+rule_order;
			//$(this).hide();			
			return false;
		});
		
		$("#content").delegate(".btn.reset", "click", function(){
			var tr_tag = $(this).parent().parent();
			disableRuleEdit(tr_tag);
			//$(this).hide();
			return false;
		});
		
		$("#content").delegate(".btn.save", "click",function(){
			if($(this).hasClass("disabled"))
				return false;
			var tr_tag = $(this).parent().parent();
			saveRule(tr_tag);						
			return false;
		});
		?????????????????????????????